<?php

namespace App\Observers;

use App\Models\VipPurchase;

class VipPurchaseObserver
{
	public function creating(VipPurchase $purchase)
	{
		if (! $purchase->number) {
			$purchase->number = serial_number(6, $purchase, 'number');
			if (! $purchase->number) {return false;}
		}
	}
}
